home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / trs141f.zip / NFMT.ZIP / NFMT.DOC < prev    next >
Text File  |  1992-07-20  |  4KB  |  126 lines

  1.  
  2.  
  3.  
  4. NFMT(1)             UNIX Programmer's Manual              NFMT(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      nfmt - simple optimal text formatter
  10.  
  11. SYNOPSIS
  12.      nfmt [ -cs ] [ -width ] [ -p prefix ] [ inputfile...  ]
  13.  
  14. DESCRIPTION
  15.      nfmt is a simple text formatter, which is very similar to the
  16.      BSD program fmt(1).  However nfmt uses a best-fit line breaking
  17.      algorithm, by a simple version of "Breaking Paragraphs into Lines",
  18.      Donald E. Knuth and Michael F. Plass, "Software--Practice and
  19.      Experience" 11 (1981) 1119-1184.
  20.  
  21.      nfmt (just like fmt ) fills and joins lines to produce output lines
  22.      of (up to) the number of characters specified in the -width option.
  23.      The default width is 75.  nfmt concatenates the inputfiles listed
  24.      as arguments.  If none are given, nfmt formats text from the
  25.      standard input.
  26.  
  27.      Blank lines are preserved in the output, as is the spacing between
  28.      words.  Tabs are expanded on input and re-introduced on output
  29.      (unlike fmt?).  Indentation is preserved in the output, and input
  30.      lines with differing indentation are not joined (unless -c is used).
  31.  
  32.      nfmt can also be used as an in-line text filter for vi(1); the
  33.      vi command:
  34.  
  35.           !}nfmt
  36.  
  37.      reformats the text between the cursor location and the end of
  38.      the paragraph.
  39.  
  40.      nfmt prefers breaking lines at the end of a sentence, and tries to
  41.      avoid line breaks after the first word of a sentence or before the
  42.      last word of a sentence.  works based on the following definitions:
  43.      A sentence break defined as either the end of a paragraph or a word
  44.      ending in [.?!], possibly followed by ) or ], followed by a word
  45.      beginning with a capital.
  46.  
  47.  
  48. OPTIONS
  49.      -c   Crown margin mode. Preserve the indentation of the
  50.           first two lines within a paragraph, and align the left margin
  51.           of each subsequent line with that of the second line.  This is
  52.           useful for tagged paragraphs.  The indentation of the first
  53.           line of a paragraph must be different from the indentation of
  54.           the second.  Subsequent lines must have the same indentation
  55.           as the second line.
  56.  
  57.      -s   Split lines only.  Do not join short lines to form
  58.           longer ones.  This prevents sample lines of code, and other such
  59.           "formatted" text, from being unduly combined.
  60.  
  61.      -width
  62.           Fill output lines to up to width columns (default 75). nfmt
  63.           prefers to make lines about 7% shorter, to give it room to
  64.           balance line lengths.
  65.  
  66.      -p prefix
  67.           Only lines beginning with the prefix (possibly preceded by
  68.           white space) are re-arranged; the prefix (with any preceding
  69.           white space) is stripped for the formatting and re-attached
  70.           to each formatted output line. For example,
  71.  
  72.              fmt -p ' * '
  73.  
  74.           formats C comments laid out in the normal way, leaving the
  75.           code unchanged.  The -p option may also be combined with the
  76.           other options.
  77.  
  78. BUGS
  79.      Very long paragraphs silently break nfmt's builtin limits.  When the
  80.      available space is full, nfmt formats what it has so far, chooses a
  81.      low cost line break near the end and flushes the paragraph to there.
  82.      There is little cost in either time or quality of output.
  83.  
  84.      The crown mode is incompatible with that of fmt(1).
  85.  
  86.      nfmt obeys the description in fmt(1) mamual: Indentation is preserved
  87.      in the output, and input lines with differing indentation are not
  88.      joined (unless -c is used). fmt(1) does not.
  89.  
  90.  
  91. SEE ALSO
  92.      fmt(1), fmt mail(1), mail(1), nroff(1), vi(1)
  93.  
  94. AUTHOR
  95.      Please send bug reports and suggestions to the author.
  96.  
  97.           Ross Paterson <rap@doc.ic.ac.uk>
  98.  
  99.      Local installation by Yossi Gil <yogi@cs.ubc.ca>
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.